<!DOCTYPE html>
<html>

<head>
  <meta charset="UTF-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta name="keywords" content="风五六 静态个人博客">
<meta name="description" content="温故而知新">
<meta name="theme-color" content="#000">
<title>ZPan - 快速搭建私人的不限速网盘！基于腾讯云的免费简单开源多用户 Go 网盘程序 | 风五六</title>
<link rel="shortcut icon" href="/favicon.ico?v=1658147970954">
<link rel="stylesheet" href="/media/css/pisces.css">
<link rel="stylesheet" href="/media/fonts/font-awesome.css">
<link
  href="//fonts.loli.net/css?family=Monda:300,300italic,400,400italic,700,700italic|Roboto Slab:300,300italic,400,400italic,700,700italic|Rosario:300,300italic,400,400italic,700,700italic|PT Mono:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext"
  rel="stylesheet" type="text/css">

<link href="/media/hljs/styles/agate.css"
  rel="stylesheet">

<link rel="stylesheet" href="/styles/main.css">
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

<script src="/media/js/jquery.js"></script>
<script src="/media/hljs/highlight.js"></script>
<script src="https://cdn.jsdelivr.net/npm/velocity-animate@1.5.0/velocity.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/velocity-animate@1.5.0/velocity.ui.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css"
  integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous">


<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js"
  integrity="sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js"
  integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"
  onload="renderMathInElement(document.body);"></script>






  <meta name="description" content="ZPan - 快速搭建私人的不限速网盘！基于腾讯云的免费简单开源多用户 Go 网盘程序" />
  <meta name="keywords" content="教程分享,软件分享" />
<!--网站加载进度条开始-->
<script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
<link href="//cdn.bootcss.com/pace/1.0.2/themes/pink/pace-theme-flash.css" rel="stylesheet">
<style>
    .pace .pace-progress {
    	background: #006eff; /*进度条颜色*/
    	height: 3px; /*进度条高度*/
    }
    .pace .pace-progress-inner {
     	box-shadow: 0 0 10px #3f3f3f, 0 0 5px #3f3f3f; /*阴影颜色*/
    }
    .pace .pace-activity {
    	border-top-color: #00ffdd;	/*上边框颜色*/
    	border-left-color: #00ffdd;	/*左边框颜色*/
    }
</style>
<!--网站加载进度条结束-->

<style type="text/css">
::-webkit-scrollbar-thumb { /*滚动条滑块*/
    background-color: #1E90FF; /*滑块颜色*/
    background-image: -webkit-linear-gradient(45deg,rgba(255,255,255,.4) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.4) 50%,rgba(255,255,255,.4) 75%,transparent 75%,transparent); /*滑块样式*/
    border-radius: 5px; /*设置圆角*/
}
::-webkit-scrollbar-track { /*滚动条滑槽*/
    background-color: #FFFACD; /*滑槽颜色*/
    border-radius: 5px; /*设置圆角*/
}
::-webkit-scrollbar { /*滚动条大小*/
    width: 8px; /*竖向滚动条的宽度*/
    height: 8px; /*横向滚动条的高度*/
}
</style>

</head>


<body>
  <div class="head-top-line"></div>
  <div class="header-box">
    
<div class="pisces">
  <header class="header  ">
    <div class="blog-header box-shadow-wrapper bg-color " id="header">
      <div class="nav-toggle" id="nav_toggle">
        <div class="toggle-box">
          <div class="line line-top"></div>
          <div class="line line-center"></div>
          <div class="line line-bottom"></div>
        </div>
      </div>
      <div class="site-meta">       
        <div class="site-title">
          
            <a href="/" class="brand">
              <span>风五六</span>
            </a>  
          
        </div>
        
          <p class="subtitle"> 𝑩𝒆 𝑴𝒚𝒔𝒆𝒍𝒇</p>
        
      </div>
      <nav class="site-nav" id="site_nav">
        <ul id="nav_ul">
          
            
            
            <li class="nav-item ">
              
              
                <a href="/" target="_self">
                  <i class="fa fa-globe"></i> 首页
                </a>
              
            </li>
          
            
            
            <li class="nav-item ">
              
              
                <a href="/archives" target="_self">
                  <i class="fa fa-globe"></i> 归档
                </a>
              
            </li>
          
            
            
            <li class="nav-item ">
              
              
                <a href="/tags" target="_self">
                  <i class="fa fa-globe"></i> 标签
                </a>
              
            </li>
          
            
            
            <li class="nav-item ">
              
              
                <a href="/post/about" target="_self">
                  <i class="fa fa-globe"></i> 关于
                </a>
              
            </li>
          
          
          
        </ul>
      </nav>
    </div>
  </header>
</div>

<script type="text/javascript"> 
 
  let showNav = true;

  let navToggle = document.querySelector('#nav_toggle'),
  siteNav = document.querySelector('#site_nav');
  
  function navClick() {
    let sideBar = document.querySelector('.sidebar');
    let navUl = document.querySelector('#nav_ul');
    navToggle.classList.toggle('nav-toggle-active');
    siteNav.classList.toggle('nav-menu-active');
    if (siteNav.classList.contains('nav-menu-active')) {
      siteNav.style = "height: " + (navUl.children.length * 42) +"px !important";
    } else {
      siteNav.style = "";
    }
  }

  navToggle.addEventListener('click',navClick);  
</script>
  </div>
  <div class="main-continer">
    
    <div
      class="section-layout pisces ">
      <div class="section-layout-wrapper">
        

<div class="sidebar">
  
    <div class="sidebar-box box-shadow-wrapper bg-color right-motion" id="sidebar">
      
      <div class="sidebar-body pisces" id="sidebar_body">
        
          
            <div style="opacity: 1;">
              <div class="toc-box right-motion">
  <div class="toc-wrapper  auto"
    id="toc_wrapper">
    <ul class="markdownIt-TOC">
<li>
<ul>
<li><a href="#%E4%B8%80-zpan%E5%AE%89%E8%A3%85%E6%89%80%E9%9C%80">一. ZPan安装所需</a><br>
*
<ul>
<li><a href="#1linux%E8%BF%9C%E7%A8%8B%E8%BF%9E%E6%8E%A5%E5%B7%A5%E5%85%B7">1.Linux远程连接工具</a></li>
<li><a href="#2linux%E6%9C%8D%E5%8A%A1%E5%99%A8">2.linux服务器</a></li>
</ul>
</li>
<li><a href="#%E4%BA%8Czpan%E5%AE%89%E8%A3%85%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87">二.ZPan安装环境准备</a><br>
*
<ul>
<li><a href="#1%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%87%86%E5%A4%87%E4%BB%A5%E8%85%BE%E8%AE%AF%E4%BA%91%E4%B8%BA%E4%BE%8B">1.服务器准备(以腾讯云为例)</a><br>
*
<ul>
<li><a href="#1%E7%99%BB%E5%BD%95%E8%85%BE%E8%AE%AF%E4%BA%91%E6%8C%89%E7%BB%8F%E6%B5%8E%E5%AE%9E%E5%8A%9B%E8%B4%AD%E4%B9%B0%E6%9C%8D%E5%8A%A1%E5%99%A8">①登录腾讯云，按经济实力购买服务器。</a></li>
<li><a href="#2%E9%85%8D%E7%BD%AE%E5%AE%89%E5%85%A8%E7%BB%84%E5%B9%B6%E5%85%B3%E8%81%94%E5%AE%9E%E4%BE%8B">②配置安全组，并关联实例。</a></li>
</ul>
</li>
<li><a href="#2%E9%85%8D%E7%BD%AE%E8%85%BE%E8%AE%AF%E4%BA%91cos">2.配置腾讯云COS</a><br>
*
<ul>
<li><a href="#1%E5%88%9B%E5%BB%BAobs%E5%AD%98%E5%82%A8%E6%A1%B6">①创建obs存储桶</a></li>
<li><a href="#2%E5%88%9B%E5%BB%BA%E5%AF%86%E9%92%A5">②创建密钥</a></li>
<li><a href="#3%E9%85%8D%E7%BD%AE%E8%AE%B0%E5%BD%95">③配置记录</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#%E4%B8%89%E5%AE%89%E8%A3%85zpan">三.安装ZPan</a><br>
*
<ul>
<li><a href="#1%E4%BD%BF%E7%94%A8xshell%E8%BF%9E%E6%8E%A5%E6%9C%8D%E5%8A%A1%E5%99%A8">1.使用XShell连接服务器。</a><br>
*
<ul>
<li><a href="#1%E4%BD%BF%E7%94%A8xshell%E8%BF%9E%E6%8E%A5%E6%9C%8D%E5%8A%A1%E5%99%A8-2">①使用XShell连接服务器</a></li>
<li><a href="#2%E6%8E%A5%E5%8F%97%E5%AF%86%E9%92%A5%E6%A0%A1%E9%AA%8C">②接受<strong>密钥校验</strong></a></li>
<li><a href="#3%E5%A1%AB%E5%86%99%E7%94%A8%E6%88%B7%E5%90%8D">③填写用户名</a></li>
<li><a href="#4%E5%A1%AB%E5%86%99%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%AF%86%E7%A0%81">④填写服务器密码</a></li>
</ul>
</li>
<li><a href="#2linux%E5%91%BD%E4%BB%A4%E5%AE%89%E8%A3%85%E8%87%AA%E5%8A%A8%E5%8C%96%E8%84%9A%E6%9C%AC">2.Linux命令安装自动化脚本</a><br>
*
<ul>
<li><a href="#1%E4%BF%AE%E6%94%B9etchosts%E6%96%87%E4%BB%B6%E5%9C%A8%E6%96%87%E4%BB%B6%E4%B8%8B%E6%B7%BB%E5%8A%A0%E4%B8%8B%E9%9D%A2%E5%86%85%E5%AE%B9">①修改/etc/hosts文件，在文件下添加下面内容；</a></li>
<li><a href="#2%E5%85%B3%E9%97%AD%E9%98%B2%E7%81%AB%E5%A2%99">②关闭防火墙；</a></li>
<li><a href="#3%E5%AE%89%E8%A3%85zpan%E6%9C%8D%E5%8A%A1">③安装zpan服务；</a></li>
<li><a href="#4%E5%90%AF%E5%8A%A8zpan%E6%9C%8D%E5%8A%A1%E6%9F%A5%E7%9C%8B%E6%9C%8D%E5%8A%A1%E7%8A%B6%E6%80%81">④启动zpan服务,查看服务状态；</a></li>
<li><a href="#5%E8%AE%BE%E7%BD%AEzpan%E6%9C%8D%E5%8A%A1%E5%BC%80%E6%9C%BA%E5%90%AF%E5%8A%A8">⑤设置zpan服务开机启动;</a></li>
<li><a href="#6%E6%9F%A5%E7%9C%8Bzpan%E5%B7%A5%E4%BD%9C%E7%AB%AF%E5%8F%A3">⑥查看zpan工作端口;</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#%E5%9B%9B%E9%85%8D%E7%BD%AEzpan">四.配置ZPan</a><br>
*
<ul>
<li><a href="#1%E9%85%8D%E7%BD%AEzpan">1.配置ZPan</a><br>
*
<ul>
<li><a href="#1%E6%B5%8F%E8%A7%88%E5%99%A8%E7%99%BB%E5%BD%95">①浏览器登录</a></li>
<li><a href="#2%E9%85%8D%E7%BD%AE%E6%95%B0%E6%8D%AE%E5%BA%93">②配置数据库</a></li>
<li><a href="#3-%E9%85%8D%E7%BD%AE%E7%AE%A1%E7%90%86%E5%91%98%E8%B4%A6%E5%8F%B7%E8%B4%A6%E5%8F%B7%E5%BF%85%E9%A1%BB%E6%98%AF%E9%82%AE%E7%AE%B1%E8%B4%A6%E5%8F%B7">③ 配置管理员账号，账号必须是<strong>邮箱账号</strong></a></li>
<li><a href="#4%E5%AE%89%E8%A3%85%E6%88%90%E5%8A%9F">④安装成功</a></li>
</ul>
</li>
<li><a href="#2%E7%99%BB%E5%BD%95zpan">2.登录Zpan</a><br>
*
<ul>
<li><a href="#1%E7%99%BB%E5%BD%95zpan">①登录Zpan</a></li>
<li><a href="#2%E5%88%9B%E5%BB%BA%E5%AD%98%E5%82%A8">②创建存储</a></li>
<li><a href="#3%E9%85%8D%E7%BD%AE%E5%AD%98%E5%82%A8">③配置存储</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#%E4%BA%94%E4%BD%BF%E7%94%A8zpan">五.使用ZPan</a><br>
*
<ul>
<li><a href="#1%E5%88%9B%E5%BB%BA%E6%96%B0%E7%94%A8%E6%88%B7">1.创建新用户</a></li>
<li><a href="#2%E6%B3%A8%E9%94%80%E7%AE%A1%E7%90%86%E5%91%98%E7%94%A8%E6%88%B7%E7%99%BB%E5%BD%95%E6%96%B0%E7%94%A8%E6%88%B7">2.注销管理员用户，登录新用户</a></li>
<li><a href="#3%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0%E4%B8%8B%E8%BD%BD%E5%88%86%E4%BA%AB">3.文件上传，下载，分享</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  </div>
</div>

<script>

  let lastTop = 0, lList = [], hList = [], postBody, lastIndex = -1;
  let active = 'active-show', activeClass = 'active-current';
  let tocWrapper = document.querySelector('#toc_wrapper');
  let tocContent = tocWrapper.children[0];
  let autoNumber = tocWrapper && tocWrapper.classList.contains('auto-number');

  function addTocNumber(elem, deep) {
    if (!elem) {
      return;
    }
    let prop = elem.__proto__;

    if (prop === HTMLUListElement.prototype) {
      for (let i = 0; i < elem.children.length; i++) {
        addTocNumber(elem.children[i], deep + (i + 1) + '.');
      }
    } else if (prop === HTMLLIElement.prototype) {
      // 保存li元素
      if (elem.children[0] && elem.children[0].__proto__ === HTMLAnchorElement.prototype) {
        lList.push(elem);
      }
      for (let i = 0; i < elem.children.length; i++) {
        let cur = elem.children[i];
        if (cur.__proto__ === HTMLAnchorElement.prototype) {
          if (autoNumber) {
            cur.text = deep + ' ' + cur.text;
          }
        } else if (cur.__proto__ === HTMLUListElement.prototype) {
          addTocNumber(cur, deep);
        }
      }
    }
  }

  function removeParentActiveClass() {
    let parents = tocContent.querySelectorAll('.' + active)
    parents.forEach(function (elem) {
      elem.classList.remove(active);
    });
  }

  function addActiveClass(index) {
    if (index >= 0 && index < hList.length) {
      lList[index].classList.add(activeClass);
    }
  }

  function removeActiveClass(index) {
    if (index >= 0 && index < hList.length) {
      lList[index].classList.remove(activeClass);
    }
  }

  function addActiveLiElemment(elem, parent) {
    if (!elem || elem === parent) {
      return;
    } else {
      if (elem.__proto__ === HTMLLIElement.prototype) {
        elem.classList.add(active);
      }
      addActiveLiElemment(elem.parentElement, parent);
    }
  }

  function showToc() {
    if (tocWrapper) {
      postBody = document.querySelector('#post_body');
      for (let i = 0; i < postBody.children.length; i++) {
        if (postBody.children[i].__proto__ === HTMLHeadingElement.prototype) {
          hList.push(postBody.children[i]);
        }
      }
      if (tocWrapper.classList.contains('compress')) {
        tocContent.classList.add('closed');
      } else if (tocWrapper.classList.contains('no_compress')) {
        tocContent.classList.add('expanded');
      } else {
        if (hList.length > 10) {
          active = 'active-hidden'
          tocContent.classList.add('closed');
        } else {
          tocContent.classList.add('expanded');
        }
      }
    }
  }

  (function () {
    // 处理不是从#一级标题开始目录
    if (tocContent.children.length === 1 && tocContent.children[0].__proto__ === HTMLLIElement.prototype) {
      let con = tocContent.children[0].children[0];
      tocContent.innerHTML = con.innerHTML;
    }
    let markdownItTOC = document.querySelector('.markdownIt-TOC');
    let innerHeight = window.innerHeight;
    markdownItTOC.style = `max-height: ${innerHeight - 80 > 0 ? innerHeight - 80 : innerHeight}px`
    addTocNumber(tocContent, '');
  })();

  document.addEventListener('scroll', function (e) {
    if (lList.length <= 0) {
      return;
    }
    let scrollTop = document.scrollingElement.scrollTop + 10;
    let dir;

    if (lastTop - scrollTop > 0) {
      dir = 'up';
    } else {
      dir = 'down';
    }

    lastTop = scrollTop;
    if (scrollTop <= 0) {
      if (lastIndex >= 0 && lastIndex < hList.length) {
        lList[lastIndex].classList.remove(activeClass);
      }
      return;
    }

    let current = 0, hasFind = false;
    for (let i = 0; i < hList.length; i++) {
      if (hList[i].offsetTop > scrollTop) {
        current = i;
        hasFind = true;
        break;
      }
    }
    if (!hasFind && scrollTop > lList[lList.length - 1].offsetTop) {
      current = hList.length - 1;
    } else {
      current--;
    }
    if (dir === 'down') {
      if (current > lastIndex) {
        addActiveClass(current);
        removeActiveClass(lastIndex)
        lastIndex = current;
        removeParentActiveClass();
        lList[current] && addActiveLiElemment(lList[current].parentElement, tocContent);
      }
    } else {
      if (current < lastIndex) {
        addActiveClass(current);
        removeActiveClass(lastIndex);
        lastIndex = current;
        removeParentActiveClass();
        lList[current] && addActiveLiElemment(lList[current].parentElement, tocContent);
      }
    }
  });


  window.addEventListener('load', function () {
    showToc();
    document.querySelector('#sidebar').style = 'display: block;';
    tocWrapper.classList.add('toc-active');
    setTimeout(function () {
      if ("createEvent" in document) {
        let evt = document.createEvent("HTMLEvents");
        evt.initEvent("scroll", false, true);
        document.dispatchEvent(evt);
      }
      else {
        document.fireEvent("scroll");
      }
    }, 500)
  })

</script>
            </div>
          
        
      </div>
    </div>
  
</div>
<script>
  const SIDEBAR_TITLE_ACTIVE = 'sidebar-title-active';
  const SIDEBAR_BODY_ACTIVE = 'sidebar-body-active';
  const SLIDE_UP_IN = 'slide-up-in';

  let sidebar = document.querySelector('#sidebar'),
  tocSideBar = document.querySelector('#tocSideBar'),
  metaSideBar = document.querySelector('#metaSideBar'),
  postToc = document.querySelector('#post_toc'),
  postSiteMeta = document.querySelector('#post_side_meta'),
  sidebarTitle = document.querySelector('.sidebar-title'),
  sidebarBody = document.querySelector('#sidebar_body');

  tocSideBar && tocSideBar.addEventListener('click', (e) => {
    toggleSidebar(e);
  });

  metaSideBar && metaSideBar.addEventListener('click', (e) => {
    toggleSidebar(e);
  });

  function toggleSidebar(e) {
    let currentTitle = document.querySelector("."+SIDEBAR_TITLE_ACTIVE);
    if (currentTitle == e.srcElement) {
      return ;
    }
    let current, showElement, hideElement;
    if (e.srcElement == metaSideBar) {
      showElement = postSiteMeta;
      hideElement = postToc;
    } else if (e.srcElement == tocSideBar){
      showElement = postToc;
      hideElement = postSiteMeta;
    }
    currentTitle.classList.remove(SIDEBAR_TITLE_ACTIVE);
    e.srcElement.classList.add(SIDEBAR_TITLE_ACTIVE);

    jQuery.Velocity(hideElement, 'stop');
    jQuery.Velocity(hideElement, 'transition.slideUpOut', {
      display: 'none',
      duration: 200,
      complete: function () {
        jQuery.Velocity(showElement, 'transition.slideDownIn', {
          duration: 200
        });
      }
    })
    hideElement.classList.remove(SIDEBAR_BODY_ACTIVE);
    showElement.classList.add(SIDEBAR_BODY_ACTIVE);
  }

  postToc && postToc.addEventListener('transitionend', function() {
    this.classList.remove(SLIDE_UP_IN);
  });

  if (sidebarBody) {
    if (sidebarBody.classList.contains('pisces') || sidebarBody.classList.contains('gemini')) {
      let hasFix = false;
      let scrollEl = document.querySelector('.main-continer');
      let limitTop = document.querySelector('#nav_ul').children.length * 42 + 162;
      window.addEventListener('scroll', function(e) {
        if (document.scrollingElement.scrollTop >= limitTop) {
          if (!hasFix) {
            sidebar.classList.add('sidebar-fixed');
            hasFix = true;
          }
        } else {
          if (hasFix) {
            sidebar.classList.remove('sidebar-fixed');
            hasFix = false;
          }
        }
      });
    }
  }
  
</script>
        <div class="section-box box-shadow-wrapper">
          <div class="section bg-color post post-page">
		  <div class="post-body">
  
  
    <img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/zpan.png" />
  
</div>

            <section class="post-header">
  <h1 class="post-title">
    <a class="post-title-link" href="https://ad-milks.gitee.io/blog/post/zpan/"> ZPan - 快速搭建私人的不限速网盘！基于腾讯云的免费简单开源多用户 Go 网盘程序 </a>
  </h1>
  <div class="post-meta">
    
    <span class="meta-item pc-show">
      <i class="fa fa-calendar-o"></i>
      <span class="language" data-lan="publish">发布于</span>
      <span class="publish-time" data-t="2020-05-13 15:23:51">2020-05-13</span>
      <span class="post-meta-divider pc-show">|</span>
    </span>
    
    <span class="meta-item">
      <i class="fa fa-folder-o"></i>
      <span class="pc-show language" data-lan="category-in">标签:</span>
       
      <a href="https://ad-milks.gitee.io/blog/tag/udQjirzBI/"> <span>教程分享</span> </a>、   
      <a href="https://ad-milks.gitee.io/blog/tag/RPhQ534D-/">
        <span>软件分享</span>
      </a>
       
    </span>
    <span class="post-meta-divider">|</span>
    
    <span class="meta-item">
      <i class="fa fa-clock-o"></i>
      <span
        >5<span class="language" data-lan="minute"
          >分钟</span
        ></span
      >
    </span>
    <span class="meta-item">
      <span class="post-meta-divider">|</span>
      <i class="fa fa-file-word-o"></i>
      <span
        >929<span class="pc-show language" data-lan="words"
          >字数</span
        ></span
      >
    </span>
      
    <span
      id="/blog/post/zpan/"
      data-flag-title="ZPan - 快速搭建私人的不限速网盘！基于腾讯云的免费简单开源多用户 Go 网盘程序"
      class="meta-item pc-show leancloud_visitors"
    >
      <span class="post-meta-divider">|</span>
      <i class="fa fa-eye"></i>
      <span
        ><span class="language" data-lan="view">浏览量:</span>:<span
          class="leancloud-visitors-count"
        ></span
      ></span>
    </span>
    
  </div>
</section>

            <div class="post-body next-md-body" id="post_body">
              <p>由于百度网盘的限速和众多网盘的不好用，很多喜欢动手的朋友都购买自己的服务器搭建私有网盘，腾讯云、阿里云、Vultr 等 VPS 都在疯狂打折！所以建议感兴趣的朋友趁机入手。有自己的服务器，你不仅可以架设专属的私有网盘用来存储备份/分享文件，还能用于搭建网站/博客、学习 Linux、搭建内网穿透、学习编程等等，即实用又能增长知识……</p>
<p>​	今天介绍的「<strong>ZPan</strong>」则是又一款追求简约轻量的基于云存储的网盘程序，并且它致力于打造成“不限速的网盘系统”。</p>
<!-- more -->
<img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/zpan_bsanner.jpg" alt="zpan_bsanner" style="zoom: 200%;" />
<h2 id="一-zpan安装所需">一. ZPan安装所需</h2>
<h4 id="1linux远程连接工具">1.Linux远程连接工具</h4>
<p>​			XShell绿色版：<a href="https://shanbai.lanzoul.com/irtWPnjtfmd">分享跳转</a>     密码:h6f4</p>
<p>​			SecureCRT绿色版：<a href="https://shanbai.lanzoul.com/iNdBdnjtlkh">分享跳转</a></p>
<h4 id="2linux服务器">2.linux服务器</h4>
<p>​			腾讯云（或阿里云）服务器</p>
<p>​			腾讯云cos（或阿里云oss）</p>
<h2 id="二zpan安装环境准备">二.ZPan安装环境准备</h2>
<h4 id="1服务器准备以腾讯云为例">1.服务器准备(以腾讯云为例)</h4>
<h6 id="1登录腾讯云按经济实力购买服务器">①登录<a href="https://cloud.tencent.com/">腾讯云</a>，按经济实力购买服务器。</h6>
<h6 id="2配置安全组并关联实例">②配置安全组，并关联实例。</h6>
<figure data-type="image" tabindex="1"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/02.png" alt="02" loading="lazy"></figure>
<figure data-type="image" tabindex="2"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/03.png" alt="03" loading="lazy"></figure>
<p>注：特别注意，一定放行<strong>TCP:8222</strong>端口</p>
<figure data-type="image" tabindex="3"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/04.png" alt="04" loading="lazy"></figure>
<h4 id="2配置腾讯云cos">2.配置腾讯云COS</h4>
<h6 id="1创建obs存储桶">①创建obs存储桶</h6>
<p>在<strong>云产品</strong>中搜索<strong>对象存储</strong>，进入后同意协议。</p>
<figure data-type="image" tabindex="4"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/01.png" alt="01" loading="lazy"></figure>
<p>点击<strong>创建存储桶</strong>。</p>
<figure data-type="image" tabindex="5"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/05.png" alt="05" loading="lazy"></figure>
<figure data-type="image" tabindex="6"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/06.png" alt="06" loading="lazy"></figure>
<p>创建成功后，点击<strong>概览</strong>。</p>
<figure data-type="image" tabindex="7"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/09.png" alt="09" loading="lazy"></figure>
<h6 id="2创建密钥">②创建密钥</h6>
<p>点击<strong>密钥管理-云API密钥管理</strong></p>
<figure data-type="image" tabindex="8"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/07.png" alt="07" loading="lazy"></figure>
<p>进入后点击<strong>新建密钥</strong></p>
<figure data-type="image" tabindex="9"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/08.png" alt="08" loading="lazy"></figure>
<h6 id="3配置记录">③配置记录</h6>
<pre><code class="language-shell">存储桶名称：
访问域名：
SecretId: 
SecretKey:

</code></pre>
<h2 id="三安装zpan">三.安装ZPan</h2>
<h4 id="1使用xshell连接服务器">1.使用XShell连接服务器。</h4>
<h6 id="1使用xshell连接服务器-2">①使用XShell连接服务器</h6>
<figure data-type="image" tabindex="10"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/10.png" alt="10" loading="lazy"></figure>
<h6 id="2接受密钥校验">②接受<strong>密钥校验</strong></h6>
<figure data-type="image" tabindex="11"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/11.png" alt="11" loading="lazy"></figure>
<h6 id="3填写用户名">③填写用户名</h6>
<figure data-type="image" tabindex="12"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/12.png" alt="12" loading="lazy"></figure>
<h6 id="4填写服务器密码">④填写服务器密码</h6>
<figure data-type="image" tabindex="13"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/13.png" alt="13" loading="lazy"></figure>
<h4 id="2linux命令安装自动化脚本">2.Linux命令安装自动化脚本</h4>
<h6 id="1修改etchosts文件在文件下添加下面内容">①修改/etc/hosts文件，在文件下添加下面内容；</h6>
<pre><code class="language-shell">[root@VM-0-9-centos ~]# vim /etc/hosts
...
140.82.112.3    gitHub.com
199.232.69.194  github.global.ssl.fastly.net
185.199.108.153 assets-cdn.github.com
185.199.109.153 assets-cdn.github.com
185.199.110.153 assets-cdn.github.com
185.199.111.153 assets-cdn.github.com

</code></pre>
<h6 id="2关闭防火墙">②关闭防火墙；</h6>
<pre><code class="language-shell">#临时关闭防火墙
[root@VM-0-9-centos ~]# systemctl  stop firewalld 
#开机禁用防火墙
[root@VM-0-9-centos ~]# systemctl  disable firewalld
</code></pre>
<h6 id="3安装zpan服务">③安装zpan服务；</h6>
<pre><code class="language-shell">[root@VM-0-9-centos ~]# curl -sSf https://dl.saltbo.cn/install.sh | sh -s zpan
</code></pre>
<h6 id="4启动zpan服务查看服务状态">④启动zpan服务,查看服务状态；</h6>
<pre><code class="language-shell">#启动zpan服务
[root@VM-0-9-centos ~]# systemctl start zpan
#查看服务状态
[root@VM-0-9-centos ~]# systemctl status zpan
● zpan.service - Zpan
   Loaded: loaded (/etc/systemd/system/zpan.service; disabled; vendor preset: disabled)
   Active: active (running) since Thu 2021-04-01 19:13:28 CST; 9s ago
     Docs: https://github.com/saltbo/zpan
 Main PID: 3721 (zpan)
   CGroup: /system.slice/zpan.service
           └─3721 /usr/local/bin/zpan server

Apr 01 19:13:28 VM-0-9-centos systemd[1]: Started Zpan.
Apr 01 19:13:28 VM-0-9-centos zpan[3721]: time=&quot;2021-04-01T19:13:28+08:00&quot; lev...0&quot;
Apr 01 19:13:28 VM-0-9-centos zpan[3721]: 2021/04/01 19:13:28 [rest server lis...2]
Hint: Some lines were ellipsized, use -l to show in full.
#第三行出现“active (running)”就表示启动成功
</code></pre>
<h6 id="5设置zpan服务开机启动">⑤设置zpan服务开机启动;</h6>
<pre><code class="language-shell">[root@VM-0-9-centos ~]# systemctl enable zpan
Created symlink from /etc/systemd/system/multi-user.target.wants/zpan.service to /etc/systemd/system/zpan.service.
</code></pre>
<h6 id="6查看zpan工作端口">⑥查看zpan工作端口;</h6>
<pre><code class="language-shell">[root@VM-0-9-centos ~]# ss -lntp |grep zpan
LISTEN     0      128       [::]:8222                  [::]:*                   users:((&quot;zpan&quot;,pid=3721,fd=3))
</code></pre>
<h2 id="四配置zpan">四.配置ZPan</h2>
<h4 id="1配置zpan">1.配置ZPan</h4>
<h6 id="1浏览器登录">①浏览器登录</h6>
<p>​	在浏览器地址栏中输入<a href="http://xn--IP-wz2cs9jou1bih4a:8222/">http://（主机公网IP）:8222/</a></p>
<figure data-type="image" tabindex="14"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/14.png" alt="14" loading="lazy"></figure>
<h6 id="2配置数据库">②配置数据库</h6>
<p>Zpan可配置4种数据库，这里选择“sqilte3”，数据库文件名称“zpan.db”保持默认不变</p>
<figure data-type="image" tabindex="15"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/15.png" alt="15" loading="lazy"></figure>
<h6 id="3-配置管理员账号账号必须是邮箱账号">③ 配置管理员账号，账号必须是<strong>邮箱账号</strong></h6>
<figure data-type="image" tabindex="16"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/16.png" alt="16" loading="lazy"></figure>
<h6 id="4安装成功">④安装成功</h6>
<figure data-type="image" tabindex="17"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/17.png" alt="17" loading="lazy"></figure>
<h4 id="2登录zpan">2.登录Zpan</h4>
<h6 id="1登录zpan">①登录Zpan</h6>
<figure data-type="image" tabindex="18"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/18.png" alt="18" loading="lazy"></figure>
<h6 id="2创建存储">②创建存储</h6>
<figure data-type="image" tabindex="19"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/19.png" alt="19" loading="lazy"></figure>
<h6 id="3配置存储">③配置存储</h6>
<figure data-type="image" tabindex="20"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/20.png" alt="20" loading="lazy"></figure>
<h2 id="五使用zpan">五.使用ZPan</h2>
<h4 id="1创建新用户">1.创建新用户</h4>
<figure data-type="image" tabindex="21"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/21.png" alt="21" loading="lazy"></figure>
<figure data-type="image" tabindex="22"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/22.png" alt="22" loading="lazy"></figure>
<h4 id="2注销管理员用户登录新用户">2.注销管理员用户，登录新用户</h4>
<figure data-type="image" tabindex="23"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/23.png" alt="23" loading="lazy"></figure>
<figure data-type="image" tabindex="24"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/24.png" alt="24" loading="lazy"></figure>
<h4 id="3文件上传下载分享">3.文件上传，下载，分享</h4>
<p>上传</p>
<figure data-type="image" tabindex="25"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/25.png" alt="25" loading="lazy"></figure>
<p>下载</p>
<figure data-type="image" tabindex="26"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/26.png" alt="26" loading="lazy"></figure>
<p>分享</p>
<figure data-type="image" tabindex="27"><img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/27.png" alt="27" loading="lazy"></figure>

            </div>
			<div>
<br/> 
  <div style="text-align:center;color: #999;font-size:14px;">---------- 本文到此结束 <i class="fa fa-paw"></i> 感谢您的阅读 ----------</div>
<br/>
</div>

            
              <div class="reward-btn">
                <div class="reward-btn-text">赞赏</div>
              </div>
            
            
              <div class="post-footer">
  <ul class="post-copyright">
    <li class="post-copyright-author">
      <strong class="language" data-lan="author">本文作者：</strong>
      风五六
    </li>
    <li class="post-copyright-link">
      <strong class="language" data-lan="link">本文链接：</strong>
      <a href="https://ad-milks.gitee.io/blog/post/zpan/" title="ZPan - 快速搭建私人的不限速网盘！基于腾讯云的免费简单开源多用户 Go 网盘程序">https://ad-milks.gitee.io/blog/post/zpan/</a>
    </li>
    <li class="post-copyright-license">
      <strong class="language" data-lan="copyright">版权声明： </strong>
      本博客所有文章除特别声明外，均采用<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="noopener" target="_blank"><i class="fa fa-fw fa-creative-commons"></i> BY-NC-SA</a> 许可协议。转载请注明出处！
    </li>
  </ul>
  <div class="tags">
    
	<a href="https://ad-milks.gitee.io/blog/tag/udQjirzBI/"><i class="fa fa-tag"></i> 教程分享</a>
    
	<a href="https://ad-milks.gitee.io/blog/tag/RPhQ534D-/"><i class="fa fa-tag"></i> 软件分享</a>
    
  </div>
  <br/><!-- 引入依赖 -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/css/share.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/social-share.js/1.0.16/js/social-share.min.js"></script>
<!-- 只要一个div的class是social-share即可，内容会自动初始化 -->
<div class="social-share" style="text-align:center;font-size:14px;" data-sites="facebook,twitter,linkedin,google,wechat,qq,qzone,weibo">分享到：</div>

  <div class="nav">
    <div class="nav-prev">
      
    </div>
    <div class="nav-next">
      
        <a class="nav-pc-next" title="Hello Gridea" href="https://ad-milks.gitee.io/blog/post/hello-gridea/">Hello Gridea</a>
        <a class="nav-mobile-next" title="Hello Gridea" href="https://ad-milks.gitee.io/blog/post/hello-gridea/">下一篇</a>
        <i class="fa fa-chevron-right"></i>
      
    </div>
  </div>
</div>
            
            
  <script src="https://cdn.jsdelivr.net/npm/valine@1.4.14/dist/Valine.min.js"></script>
<div id="vcomments" style="padding: 10px 0px 0px 0px"></div>

<style>
  .v .veditor {
    min-height: 10rem;
    background-image: url('');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: right;
    background-color: rgba(255, 255, 255, 0);
    resize: none;
  }

  .v .vwrap {
    border: 1px solid #000 !important;
  }

  .v .vbtn {
    padding: .4rem 1.2rem !important;
    border-color: #fff !important;
    background-color: #49b1f5 !important;
    color: #fff !important;
    font-size: .7rem !important;
  }

  .v .vcards .vcard .vh .vmeta .vat {
    padding: 0 .8rem !important;
    border: 1px solid #00c4b6 !important;
    border-radius: 5px !important;
    color: #00c4b6 !important;
  }
</style>
<script>
  new Valine({
    el: '#vcomments',
    appId: 'p5DPrdJbaIDTuyXDvXyUVHaq-gzGzoHsz',
    appKey: '7357Y6D8RgoOuJzxlWNQOFj0',
    avatar: 'monsterid',
    placeholder: '',
    pageSize: '6',
    lang: 'zh-cn',
    enableQQ: 'true' === 'false',
    visitor: 'true' === 'true',
    highlight: 'true' === 'true',
    avatarForce: 'true' === 'false',
    serverURLs: '',
		recordIP: 'true' === 'true',
  });
</script>

          </div>
        </div>
      </div>
    </div>
    <div class="footer-box">
  <footer class="footer">
        <center id="runTimeBox">
      网站已安全运行： <span id="run_time"></span>
    </center>
    <i class="fa fa-eye"></i><span id="busuanzi_container_site_pv">总访问量： <span id="busuanzi_value_site_pv"></span> 次</span>
    <span class="post-meta-divider">|</span>
    <i class="fa fa-users"></i><span id="busuanzi_container_site_uv">总访客数： <span id="busuanzi_value_site_uv"></span> 人</span>


        <script>
      BirthDay = new Date('2019/06/27');
      if (BirthDay.getTime()) {
        function runTime() {
          str = "";
          today = new Date();
          timeold = today.getTime() - BirthDay.getTime();
          sectimeold = timeold / 1000
          secondsold = Math.floor(sectimeold);
          msPerDay = 24 * 60 * 60 * 1000
          msPerYear = 365 * 24 * 60 * 60 * 1000
          e_daysold = timeold / msPerDay % 365
          e_yearsold = timeold / msPerYear
          daysold = Math.floor(e_daysold);
          yearsold = Math.floor(e_yearsold);
          str = yearsold + " 年 ";
          str += daysold + " 天 ";
          str += today.getHours() + " 时 ";
          str += today.getMinutes() + " 分 ";
          str += today.getSeconds() + " 秒";
          return str;
        }
        setInterval(function () {
          $("#run_time").html(runTime());
        }, 1000);
      } else {
        document.querySelector('.footer').removeChild(document.querySelector('#runTimeBox'));
      }
    </script>

    <div class="poweredby">
      版权所有©2019-2022<a href="https://github.com/feng565" target="_blank">  风五六 
 </a>   ， 保留一切权利。  | &nbsp; Theme By<a href="https://github.com/hsxyhao/gridea-theme-next" target="_blank">HsxyHao</a> </br>本博客所有文章除特别声明外，均采用 <a href="/go?url=https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="noopener" target="_blank"><i class="fa fa-fw fa-creative-commons"></i> BY-NC-SA </a> 许可协议。转载请注明出处！
    </div>
  </footer>
  
    
        <div class="pisces back-to-top" id="back_to_top">
          <i class="fa fa-arrow-up"></i>
          
            <span class="scrollpercent"> <span id="back_to_top_text">0</span>% </span>
            
        </div>
        
          
            
              <div class="bg-img">
                <img src="https://blog-feng-tu-1305029367.cos.ap-guangzhou.myqcloud.com/Img/beijing.jpg" />
              </div>
              
                
                  
                    
<link rel="stylesheet" href="/media/live2d/css/live2d.css" />
<div class="box-scale">
  <div id="landlord" style="left: 1%px;bottom: 1%px;"
    data-key="">
    <canvas id="live2d" width="500" height="560" class="live2d"></canvas>
    

      <div class="message" style="opacity:0"></div>
      <div class="live_talk_input_body">
        <div class="live_talk_input_name_body">
          <input name="name" type="text" class="live_talk_name white_input" id="AIuserName" autocomplete="off"
            placeholder="你的名字" />
        </div>
        <div class="live_talk_input_text_body">
          <input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off"
            placeholder="要和我聊什么呀？" />
          <button type="button" class="live_talk_send_btn" id="talk_send">发送</button>
        </div>
      </div>
      <input name="live_talk" id="live_talk" value="1" type="hidden" />
      <div class="live_ico_box">
        <div class="live_ico_item type_info" id="showInfoBtn"></div>
        <div class="live_ico_item type_talk" id="showTalkBtn"></div>
        
        <div class="live_ico_item type_youdu" id="youduButton"></div>
        <div class="live_ico_item type_quit" id="hideButton"></div>
        <input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
        <audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
        <input id="duType" value="douqilai" type="hidden">
        
      </div>
    
  </div>
</div>
<div id="open_live2d">召唤看板娘</div>
<script>
  var message_Path = 'https://cdn.jsdelivr.net/gh/hsxyhao/live2d.github.io@master/';
  let landlord = document.querySelector('#landlord');
  var apiKey = landlord.dataset.key;
</script>
<script type="text/javascript" src="/media/live2d/js/live2d.js"></script>
<script>
	var home_Path = document.location.protocol + '//' + window.document.location.hostname + ":" + window.document.location.port + '/';
	var userAgent = window.navigator.userAgent.toLowerCase();
	var norunAI = ["android", "iphone", "ipod", "ipad", "windows phone", "mqqbrowser", "msie", "trident/7.0"];
	var norunFlag = false;

	for (var i = 0; i < norunAI.length; i++) {
		if (userAgent.indexOf(norunAI[i]) > -1) {
			norunFlag = true;
			break;
		}
	}

	if (!window.WebGLRenderingContext) {
		norunFlag = true;
	}

	if (!norunFlag) {
		var hitFlag = false;
		var AIFadeFlag = false;
		var liveTlakTimer = null;
		var sleepTimer_ = null;
		var AITalkFlag = false;
		var talkNum = 0;
		(function () {
			function renderTip(template, context) {
				var tokenReg = /(\\)?\{([^\{\}\\]+)(\\)?\}/g;
				return template.replace(tokenReg, function (word, slash1, token, slash2) {
					if (slash1 || slash2) {
						return word.replace('\\', '');
					}
					var variables = token.replace(/\s/g, '').split('.');
					var currentObject = context;
					var i, length, variable;
					for (i = 0, length = variables.length; i < length; ++i) {
						variable = variables[i];
						currentObject = currentObject[variable];
						if (currentObject === undefined || currentObject === null) return '';
					}
					return currentObject;
				});
			}

			String.prototype.renderTip = function (context) {
				return renderTip(this, context);
			};

			var re = /x/;
			re.toString = function () {
				showMessage('哈哈，你打开了控制台，是想要看看我的秘密吗？', 5000);
				return '';
			};

			$(document).on('copy', function () {
				showMessage('你都复制了些什么呀，转载要记得加上出处哦~~', 5000);
			});

			function initTips() {
				$.ajax({
					cache: true,
					url: message_Path + 'message.json',
					dataType: "json",
					success: function (result) {
						$.each(result.mouseover, function (index, tips) {
							$(tips.selector).mouseover(function () {
								var text = tips.text;
								if (Array.isArray(tips.text)) text = tips.text[Math.floor(Math.random() * tips.text.length + 1) - 1];
								text = text.renderTip({ text: $(this).text() });
								showMessage(text, 3000);
								talkValTimer();
								clearInterval(liveTlakTimer);
								liveTlakTimer = null;
							});
							$(tips.selector).mouseout(function () {
								showHitokoto();
								if (liveTlakTimer == null) {
									liveTlakTimer = window.setInterval(function () {
										showHitokoto();
									}, 15000);
								};
							});
						});
						$.each(result.click, function (index, tips) {
							$(tips.selector).click(function () {
								if (hitFlag) {
									return false
								}
								hitFlag = true;
								setTimeout(function () {
									hitFlag = false;
								}, 8000);
								var text = tips.text;
								if (Array.isArray(tips.text)) text = tips.text[Math.floor(Math.random() * tips.text.length + 1) - 1];
								text = text.renderTip({ text: $(this).text() });
								showMessage(text, 3000);
							});
							clearInterval(liveTlakTimer);
							liveTlakTimer = null;
							if (liveTlakTimer == null) {
								liveTlakTimer = window.setInterval(function () {
									showHitokoto();
								}, 15000);
							};
						});
					}
				});
			}
			initTips();

			var text;
			if (document.referrer !== '') {
				var referrer = document.createElement('a');
				referrer.href = document.referrer;
				text = '嗨！来自 <span style="color:#0099cc;">' + referrer.hostname + '</span> 的朋友！';
				var domain = referrer.hostname.split('.')[1];
				if (domain == 'baidu') {
					text = '嗨！ 来自 百度搜索 的朋友！<br>欢迎访问<span style="color:#0099cc;">「 ' + document.title.split(' - ')[0] + ' 」</span>';
				} else if (domain == 'so') {
					text = '嗨！ 来自 360搜索 的朋友！<br>欢迎访问<span style="color:#0099cc;">「 ' + document.title.split(' - ')[0] + ' 」</span>';
				} else if (domain == 'google') {
					text = '嗨！ 来自 谷歌搜索 的朋友！<br>欢迎访问<span style="color:#0099cc;">「 ' + document.title.split(' - ')[0] + ' 」</span>';
				}
			} else {
				if (window.location.href == home_Path) { //主页URL判断，需要斜杠结尾
					var now = (new Date()).getHours();
					if (now > 23 || now <= 5) {
						text = '你是夜猫子呀？这么晚还不睡觉，明天起的来嘛？';
					} else if (now > 5 && now <= 7) {
						text = '早上好！一日之计在于晨，美好的一天就要开始了！';
					} else if (now > 7 && now <= 11) {
						text = '上午好！工作顺利嘛，不要久坐，多起来走动走动哦！';
					} else if (now > 11 && now <= 14) {
						text = '中午了，工作了一个上午，现在是午餐时间！';
					} else if (now > 14 && now <= 17) {
						text = '午后很容易犯困呢，今天的运动目标完成了吗？';
					} else if (now > 17 && now <= 19) {
						text = '傍晚了！窗外夕阳的景色很美丽呢，最美不过夕阳红~~';
					} else if (now > 19 && now <= 21) {
						text = '晚上好，今天过得怎么样？';
					} else if (now > 21 && now <= 23) {
						text = '已经这么晚了呀，早点休息吧，晚安~~';
					} else {
						text = '嗨~ 快来逗我玩吧！';
					}
				} else {
					text = '欢迎阅读<span style="color:#0099cc;">「 ' + document.title.split(' - ')[0] + ' 」</span>';
				}
			}
			showMessage(text, 12000);
		})();

		liveTlakTimer = setInterval(function () {
			showHitokoto();
		}, 15000);

		function showHitokoto() {
			if (sessionStorage.getItem("Sleepy") !== "1") {
				if (!AITalkFlag) {
					$.getJSON('https://v1.hitokoto.cn/', function (result) {
						talkValTimer();
						showMessage(result.hitokoto, 0);
					});
				}
			} else {
				hideMessage(0);
				if (sleepTimer_ == null) {
					sleepTimer_ = setInterval(function () {
						checkSleep();
					}, 200);
				}
			}
		}

		function checkSleep() {
			var sleepStatu = sessionStorage.getItem("Sleepy");
			if (sleepStatu !== '1') {
				talkValTimer();
				showMessage('你回来啦~', 0);
				clearInterval(sleepTimer_);
				sleepTimer_ = null;
			}
		}

		function showMessage(text, timeout) {
			if (Array.isArray(text)) text = text[Math.floor(Math.random() * text.length + 1) - 1];
			$('.message').stop();
			$('.message').html(text);
			$('.message').fadeTo(200, 1);
			//if (timeout === null) timeout = 5000;
			//hideMessage(timeout);
		}
		function talkValTimer() {
			$('#live_talk').val('1');
		}

		function hideMessage(timeout) {
			//$('.message').stop().css('opacity',1);
			if (timeout === null) timeout = 5000;
			$('.message').delay(timeout).fadeTo(200, 0);
		}

		function initLive2d() {
			$('#hideButton').on('click', function () {
				if (AIFadeFlag) {
					return false;
				} else {
					AIFadeFlag = true;
					localStorage.setItem("live2dhidden", "0");
					$('#landlord').fadeOut(200);
					$('#open_live2d').delay(200).fadeIn(200);
					setTimeout(function () {
						AIFadeFlag = false;
					}, 300);
				}
			});
			$('#open_live2d').on('click', function () {
				if (AIFadeFlag) {
					return false;
				} else {
					AIFadeFlag = true;
					localStorage.setItem("live2dhidden", "1");
					$('#open_live2d').fadeOut(200);
					$('#landlord').delay(200).fadeIn(200);
					setTimeout(function () {
						AIFadeFlag = false;
					}, 300);
				}
			});
			$('#youduButton').on('click', function () {
				if ($('#youduButton').hasClass('doudong')) {
					var typeIs = $('#youduButton').attr('data-type');
					$('#youduButton').removeClass('doudong');
					$('body').removeClass(typeIs);
					$('#youduButton').attr('data-type', '');
				} else {
					var duType = $('#duType').val();
					var duArr = duType.split(",");
					var dataType = duArr[Math.floor(Math.random() * duArr.length)];

					$('#youduButton').addClass('doudong');
					$('#youduButton').attr('data-type', dataType);
					$('body').addClass(dataType);
				}
			});
			if (apiKey) {
				$('#showInfoBtn').on('click', function () {
					var live_statu = $('#live_statu_val').val();
					if (live_statu == "0") {
						return
					} else {
						$('#live_statu_val').val("0");
						$('.live_talk_input_body').fadeOut(500);
						AITalkFlag = false;
						showHitokoto();
						$('#showTalkBtn').show();
						$('#showInfoBtn').hide();
					}
				});
				$('#showTalkBtn').on('click', function () {
					var live_statu = $('#live_statu_val').val();
					if (live_statu == "1") {
						return
					} else {
						$('#live_statu_val').val("1");
						$('.live_talk_input_body').fadeIn(500);
						AITalkFlag = true;
						$('#showTalkBtn').hide();
						$('#showInfoBtn').show();

					}
				});
				$('#talk_send').on('click', function () {
					var info_ = $('#AIuserText').val();
					var userid_ = $('#AIuserName').val();
					if (info_ == "") {
						showMessage('写点什么吧！', 0);
						return;
					}
					if (userid_ == "") {
						showMessage('聊之前请告诉我你的名字吧！', 0);
						return;
					}
					showMessage('思考中~', 0);
					let protocol = window.location.protocol.indexOf("s") > 0 ? "https" : "http";
					$.ajax({
						type: "get",
						url: `${protocol}://www.tuling123.com/openapi/api?key=${apiKey}&info=${info_}`,
						dataType: "json",
						success: function (res) {
							talkValTimer();
							showMessage(res.text, 0);
							$('#AIuserText').val("");
							sessionStorage.setItem("live2duser", userid_);
						},
						error: function (e) {
							talkValTimer();
							showMessage('似乎有什么错误，请和站长联系！', 0);
						}
					});
				});
			} else {
				$('#showInfoBtn').hide();
				$('#showTalkBtn').hide();
			}
			//获取音乐信息初始化
			var bgmListInfo = $('input[name=live2dBGM]');
			if (bgmListInfo.length == 0) {
				$('#musicButton').hide();
			} else {
				var bgmPlayNow = parseInt($('#live2d_bgm').attr('data-bgm'));
				var bgmPlayTime = 0;
				var live2dBGM_Num = sessionStorage.getItem("live2dBGM_Num");
				var live2dBGM_PlayTime = sessionStorage.getItem("live2dBGM_PlayTime");
				if (live2dBGM_Num) {
					if (live2dBGM_Num <= $('input[name=live2dBGM]').length - 1) {
						bgmPlayNow = parseInt(live2dBGM_Num);
					}
				}
				if (live2dBGM_PlayTime) {
					bgmPlayTime = parseInt(live2dBGM_PlayTime);
				}
				var live2dBGMSrc = bgmListInfo.eq(bgmPlayNow).val();
				$('#live2d_bgm').attr('data-bgm', bgmPlayNow);
				$('#live2d_bgm').attr('src', live2dBGMSrc);
				$('#live2d_bgm')[0].currentTime = bgmPlayTime;
				$('#live2d_bgm')[0].volume = 0.5;
				var live2dBGM_IsPlay = sessionStorage.getItem("live2dBGM_IsPlay");
				var live2dBGM_WindowClose = sessionStorage.getItem("live2dBGM_WindowClose");
				if (live2dBGM_IsPlay == '0' && live2dBGM_WindowClose == '0') {
					$('#live2d_bgm')[0].play();
					$('#musicButton').addClass('play');
				}
				sessionStorage.setItem("live2dBGM_WindowClose", '1');
				$('#musicButton').on('click', function () {
					if ($('#musicButton').hasClass('play')) {
						$('#live2d_bgm')[0].pause();
						$('#musicButton').removeClass('play');
						sessionStorage.setItem("live2dBGM_IsPlay", '1');
					} else {
						$('#live2d_bgm')[0].play();
						$('#musicButton').addClass('play');
						sessionStorage.setItem("live2dBGM_IsPlay", '0');
					}
				});
				window.onbeforeunload = function () {
					sessionStorage.setItem("live2dBGM_WindowClose", '0');
					if ($('#musicButton').hasClass('play')) {
						sessionStorage.setItem("live2dBGM_IsPlay", '0');
					}
				}
				document.getElementById('live2d_bgm').addEventListener("timeupdate", function () {
					var live2dBgmPlayTimeNow = document.getElementById('live2d_bgm').currentTime;
					sessionStorage.setItem("live2dBGM_PlayTime", live2dBgmPlayTimeNow);
				});
				document.getElementById('live2d_bgm').addEventListener("ended", function () {
					var listNow = parseInt($('#live2d_bgm').attr('data-bgm'));
					listNow++;
					if (listNow > $('input[name=live2dBGM]').length - 1) {
						listNow = 0;
					}
					var listNewSrc = $('input[name=live2dBGM]').eq(listNow).val();
					sessionStorage.setItem("live2dBGM_Num", listNow);
					$('#live2d_bgm').attr('src', listNewSrc);
					$('#live2d_bgm')[0].play();
					$('#live2d_bgm').attr('data-bgm', listNow);
				});
				document.getElementById('live2d_bgm').addEventListener("error", function () {
					$('#live2d_bgm')[0].pause();
					$('#musicButton').removeClass('play');
					showMessage('音乐似乎加载不出来了呢！', 0);
				});
			}
			//获取用户名
			var live2dUser = sessionStorage.getItem("live2duser");
			if (live2dUser !== null) {
				$('#AIuserName').val(live2dUser);
			}
			//获取位置
			var landL = sessionStorage.getItem("historywidth");
			var landB = sessionStorage.getItem("historyheight");
			if (landL == null || landB == null) {
				landL = '5px'
				landB = '0px'
			}
			$('#landlord').css('left', landL + 'px');
			$('#landlord').css('bottom', landB + 'px');
			//移动
			function getEvent() {
				return window.event || arguments.callee.caller.arguments[0];
			}
			var smcc = document.getElementById("landlord");
			var moveX = 0;
			var moveY = 0;
			var moveBottom = 0;
			var moveLeft = 0;
			var moveable = false;
			var docMouseMoveEvent = document.onmousemove;
			var docMouseUpEvent = document.onmouseup;
			smcc.onmousedown = function () {
				var ent = getEvent();
				moveable = true;
				moveX = ent.clientX;
				moveY = ent.clientY;
				var obj = smcc;
				moveBottom = parseInt(obj.style.bottom);
				moveLeft = parseInt(obj.style.left);
				if (isFirefox = navigator.userAgent.indexOf("Firefox") > 0) {
					window.getSelection().removeAllRanges();
				}
				document.onmousemove = function () {
					if (moveable) {
						var ent = getEvent();
						var x = moveLeft + ent.clientX - moveX;
						var y = moveBottom + (moveY - ent.clientY);
						obj.style.left = x + "px";
						obj.style.bottom = y + "px";
					}
				};
				document.onmouseup = function () {
					if (moveable) {
						var historywidth = obj.style.left;
						var historyheight = obj.style.bottom;
						historywidth = historywidth.replace('px', '');
						historyheight = historyheight.replace('px', '');
						sessionStorage.setItem("historywidth", historywidth);
						sessionStorage.setItem("historyheight", historyheight);
						document.onmousemove = docMouseMoveEvent;
						document.onmouseup = docMouseUpEvent;
						moveable = false;
						moveX = 0;
						moveY = 0;
						moveBottom = 0;
						moveLeft = 0;
					}
				};
			};
		}
		$(document).ready(function () {
			var AIimgSrc = [];
			let chooseLive2d = 'aoba'
			if (chooseLive2d === 'histoire') {
				AIimgSrc.push(message_Path + "model/histoire/histoire.1024/texture_00.png");
				AIimgSrc.push(message_Path + "model/histoire/histoire.1024/texture_01.png");
				AIimgSrc.push(message_Path + "model/histoire/histoire.1024/texture_02.png");
				AIimgSrc.push(message_Path + "model/histoire/histoire.1024/texture_03.png");
			} else if (chooseLive2d === 'rem') {
				AIimgSrc.push(message_Path + "model/rem/remu2048/texture_00.png");
			} else if (chooseLive2d === 'aoba') {
				AIimgSrc.push(message_Path + "model/aoba/textures/texture_00.png");
			} else if (chooseLive2d === 'hijiki') {
				AIimgSrc.push(message_Path + "model/hijiki/moc/hijiki.2048/texture_00.png");
			} else if (chooseLive2d === 'tororo') {
				AIimgSrc.push(message_Path + "model/tororo/moc/tororo.2048/texture_00.png");
			}
			var images = [];
			var imgLength = AIimgSrc.length;
			var loadingNum = 0;
			for (var i = 0; i < imgLength; i++) {
				images[i] = new Image();
				images[i].src = AIimgSrc[i];
				images[i].onload = function () {
					loadingNum++;
					if (loadingNum === imgLength) {
						var live2dhidden = localStorage.getItem("live2dhidden");
						if (live2dhidden === "0") {
							setTimeout(function () {
								$('#open_live2d').fadeIn(200);
							}, 1300);
						} else {
							setTimeout(function () {
								$('#landlord').fadeIn(200);
							}, 1300);
						}
						let model = '';
						if (chooseLive2d === 'histoire') {
							model = message_Path + "model/histoire/model.json";
						} else if (chooseLive2d === 'rem') {
							model = message_Path + "model/rem/model.json";
						} else if (chooseLive2d === 'aoba') {
							model = message_Path + "model/aoba/model.json";
						} else if (chooseLive2d === 'hijiki') {
							model = message_Path + "model/hijiki/hijiki.model.json";
						} else if (chooseLive2d === 'tororo') {
							model = message_Path + "model/tororo/tororo.model.json";
						}
						setTimeout(function () {
							loadlive2d("live2d", model);
						}, 1000);
						initLive2d();
						images = null;
					}
				}
			}
		});
	}
</script>
                      
                        
</div>
<script>
  let sideBarOpen = "sidebar-open";
  let body = document.body;
  let back2Top = document.querySelector("#back_to_top"),
    back2TopText = document.querySelector("#back_to_top_text"),
    drawerBox = document.querySelector("#drawer_box"),
    rightSideBar = document.querySelector(".sidebar"),
    viewport = document.querySelector("body");

  function scrollAnimation(currentY, targetY) {
    let needScrollTop = targetY - currentY;
    let _currentY = currentY;
    setTimeout(() => {
      const dist = Math.ceil(needScrollTop / 10);
      _currentY += dist;
      window.scrollTo(_currentY, currentY);
      if (needScrollTop > 10 || needScrollTop < -10) {
        scrollAnimation(_currentY, targetY);
      } else {
        window.scrollTo(_currentY, targetY);
      }
    }, 1);
  }

  back2Top.addEventListener("click", function (e) {
    scrollAnimation(document.scrollingElement.scrollTop, 0);
    e.stopPropagation();
    return false;
  });

  window.addEventListener("scroll", function (e) {
    let percent =
      (document.scrollingElement.scrollTop /
        (document.scrollingElement.scrollHeight -
          document.scrollingElement.clientHeight)) *
      100;
    if (percent > 1 && !back2Top.classList.contains("back-top-active")) {
      back2Top.classList.add("back-top-active");
    }
    if (percent == 0) {
      back2Top.classList.remove("back-top-active");
    }
    if (back2TopText) {
      back2TopText.textContent = Math.floor(percent);
    }
  });

  let hasCacu = false;
  window.addEventListener("resize", function (e) {
    calcuHeight();
  });

  function calcuHeight() {
    // 动态调整站点概览高度
    if (
      (!hasCacu && back2Top.classList.contains("pisces")) ||
      back2Top.classList.contains("gemini")
    ) {
      let sideBar = document.querySelector(".sidebar");
      let navUl = document.querySelector("#site_nav");
      sideBar.style =
        "margin-top:" + (navUl.offsetHeight + navUl.offsetTop + 15) + "px;";
      hasCacu = true;
    }
  }
  calcuHeight();

  let open = false,
    MOTION_TIME = 300,
    RIGHT_MOVE_DIS = "320px";

  if (drawerBox) {
    let rightMotions = document.querySelectorAll(".right-motion");
    let right = drawerBox.classList.contains("right");

    let transitionDir = right
      ? "transition.slideRightIn"
      : "transition.slideLeftIn";

    let openProp, closeProp;
    if (right) {
      openProp = {
        paddingRight: RIGHT_MOVE_DIS,
      };
      closeProp = {
        paddingRight: "0px",
      };
    } else {
      openProp = {
        paddingLeft: RIGHT_MOVE_DIS,
      };
      closeProp = {
        paddingLeft: "0px",
      };
    }

    drawerBox.onclick = function () {
      open = !open;
      jQuery.Velocity(rightSideBar, "stop");
      jQuery.Velocity(viewport, "stop");
      jQuery.Velocity(rightMotions, "stop");
      if (open) {
        jQuery.Velocity(
          rightSideBar,
          {
            width: RIGHT_MOVE_DIS,
          },
          {
            duration: MOTION_TIME,
            begin: function () {
              jQuery.Velocity(rightMotions, transitionDir, {});
            },
          }
        );
        jQuery.Velocity(viewport, openProp, {
          duration: MOTION_TIME,
        });
      } else {
        jQuery.Velocity(
          rightSideBar,
          {
            width: "0px",
          },
          {
            duration: MOTION_TIME,
            begin: function () {
              jQuery.Velocity(rightMotions, {
                opacity: 0,
              });
            },
          }
        );
        jQuery.Velocity(viewport, closeProp, {
          duration: MOTION_TIME,
        });
      }
      for (let i = 0; i < drawerBox.children.length; i++) {
        drawerBox.children[i].classList.toggle("muse-line");
      }
      drawerBox.classList.toggle(sideBarOpen);
    };
  }

  // 链接跳转
  let newWindow = "false";
  if (newWindow === "true") {
    let links = document.querySelectorAll(".post-body a");
    links.forEach((item) => {
      if (!item.classList.contains("btn")) {
        item.setAttribute("target", "_blank");
      }
    });
  }

  let faSearch = document.querySelector("#fa_search");
  faSearch &&
    faSearch.addEventListener("click", function () {
      document.querySelector("#search_mask").style = "";
    });

  // 代码高亮
  hljs.initHighlightingOnLoad();

  // 离开当前页title变化
  var leaveTitle = "你怎么走了༼ つ ◕_◕ ༽つ 快回来啊";
  var normal_title = document.title;
  if (leaveTitle) {
    document.addEventListener("visibilitychange", function () {
      if (document.visibilityState == "hidden") {
        normal_title = document.title;
        document.title = leaveTitle;
      } else {
        document.title = normal_title;
      }
    });
  }
</script>

<link rel="stylesheet" href="/media/css/jquery.fancybox.css" />
<script src="/media/js/jquery.fancybox.js"></script>

<script>
  let images = document.querySelectorAll(".section img");
  images.forEach((image) => {
    var parent = image.parentElement;
    var next = image.nextElementSibling;
    parent.removeChild(image);
    var aelem = document.createElement("a");
    aelem.href = image.src;
    aelem.dataset["fancybox"] = "images";
    aelem.dataset["rel"] = "fancybox-button";
    aelem.classList.add("fancybox");
    aelem.appendChild(image);
    parent.insertBefore(aelem, next);
  });
</script>
    <div class="reward-mask" style="display: none;">
  <div class="reward-relative">
    <span class="close" aria-hidden="true">x</span>
    <div class="reward-body">
      <h2>感谢您的支持，我会继续努力的!</h2>
      <div class="reward-img-box">
        <div style="position: relative; width: 140px; height: 140px;">
          
          
          
        </div>
      </div>
      <p class="reward-word">扫码打赏，你说多少就多少</p>
      <p class="reward-tip"> </p>
    </div>
    <div class="bottom">
      
      
    </div>
  </div>
</div>
<style>
  .reward-mask {
    position: fixed;
    z-index: 99999;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #00000054;
  }

  .reward-relative {
    position: relative;
    width: 480px;
    text-align: center;
    margin: 0 auto;
    border-radius: 5px;
    background-color: #fff;
    top: 50%;
    margin-top: -205px;
  }

  .reward-relative .close {
    position: absolute;
    right: 10px;
    font-weight: normal;
    font-size: 16px;
    color: #929292;
  }

  .reward-body {
    padding: 40px 20px 20px;
  }

  .bottom {
    display: flex;
  }

  .reward-btn {
    text-align: center;
  }

  .reward-btn-text {
    display: inline-block;
    cursor: pointer;
    width: 60px;
    height: 60px;
    line-height: 60px;
    border-radius: 50%;
    background-color: #ff9734;
    color: #FFF;
    margin-top: 20px;
  }

  .pay-text {
    margin-top: 10px;
    padding: 10px;
    flex: 1;
    transition: all .2s linear;
  }

  .pay-text:hover {
    background-color: #a5a5a536;
  }

  .reward-body h2 {
    padding-top: 10px;
    text-align: center;
    color: #a3a3a3;
    font-size: 16px;
    font-weight: normal;
    margin: 0 0 20px;
  }

  .reward-body h2:after,
  .reward-body h2:before {
    font-family: Arial, Helvetica, sans-serif;
    background: 0 0;
    width: 0;
    height: 0;
    font-style: normal;
    color: #eee;
    font-size: 80px;
    position: absolute;
    top: 20px;
  }

  .reward-body h2:before {
    content: '\201c';
    left: 50px;
  }

  .reward-body h2:after {
    content: '\201d';
    right: 80px;
  }

  .reward-img-box {
    display: inline-block;
    padding: 10px;
    border: 6px solid #ea5f00;
    margin: 0 auto;
    border-radius: 3px;
    position: relative;
  }

  .reward-img {
    position: absolute;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
  }

  @media (max-width: 767px) {
    .reward-relative {
      height: 100%;
      top: 0px;
      margin-top: 0;
      width: auto;
    }

    .reward-relative .bottom {
      flex-direction: column;
    }

    .reward-relative .pay-text {
      width: 80%;
      margin: 5px auto;
      border: 1px solid silver;
      padding: 6px;
      border-radius: 4px;
    }

    .reward-body h2:after {
      right: 40px;
    }

    .reward-body h2:after,
    .reward-body h2:before {
      font-size: 60px;
    }

    .reward-body h2:before {
      left: 20px;
    }
  }
</style>
<script>
  !function () {
    var mask = document.querySelector('.reward-mask');
    let close = document.querySelector('.reward-relative .close');
    let rewardBtn = document.querySelector('.reward-btn');

    let zfb = document.querySelector('#zfb'),
      wx = document.querySelector('#wx'),
      zfbBtn = document.querySelector('#zfbBtn'),
      wxBtn = document.querySelector('#wxBtn');

    if (zfbBtn && wxBtn) {
      zfbBtn.addEventListener('click', () => {
        jQuery.Velocity(zfb, 'transition.slideLeftIn', {
          duration: 400
        });
        jQuery.Velocity(wx, 'transition.slideRightOut', {
          display: 'none',
          duration: 400
        });
      });

      wxBtn.addEventListener('click', () => {
        jQuery.Velocity(wx, 'transition.slideRightIn', {
          duration: 400
        });
        jQuery.Velocity(zfb, 'transition.slideLeftOut', {
          display: 'none',
          duration: 400
        });
      });
    }

    rewardBtn.addEventListener('click', (e) => {
      jQuery.Velocity(mask, 'transition.slideDownIn', {
        duration: 400
      })
    });

    close.addEventListener('click', (e) => {
      e.preventDefault();
      jQuery.Velocity(mask, 'transition.slideUpOut', {
        duration: 400
      })
    })
  }()
</script>

  </div>
  <!--夜间模式开始-->

<style>
.set-view-mode { /*正常模式下按钮总体样式*/
    position: fixed;
    left: 20px;
    top: 20px;
    z-index: 300;
    background: #000000;
    width: 30px;
    height: 30px;
    border-radius: 30px;
    -moz-border-radius: 10px;
    color: #FFFFFF;
    opacity: .8;
    text-align: center;
}
.set-view-mode i { /*正常模式下按钮图标样式*/
    width: 100%;
    height: 100%;
    display: block;
    line-height: 30px;
    font-size: 20px;
    color: #FFFFFF;
}
.cover{ /*正常模式下遮罩样式（应设置为全透明）*/
    position:fixed;
    top: 0px;
    left: 0px;
    outline:5000px solid rgba(0, 0, 0, 0);
    z-index: 99999;
}
.night-mode .set-view-mode { /*夜间模式下按钮总体样式*/
    position: fixed;
    left: 20px;
    top: 20px;
    z-index: 300;
    background: #FFFFFF;
    width: 30px;
    height: 30px;
    border-radius: 30px;
    -moz-border-radius: 10px;
    color: #000000;
    opacity: .8;
    text-align: center;
}
.night-mode .set-view-mode i { /*夜间模式下按钮图标样式*/
    width: 100%;
    height: 100%;
    display: block;
    line-height: 30px;
    font-size: 20px;
    color: #000000;
}
.night-mode .cover{ /*夜间模式下遮罩样式（应设置为黑色半透明）*/
    position:fixed;
    top: 0px;
    left: 0px;
    outline:5000px solid rgba(0, 0, 0, 0.3); 
    z-index: 99999;
}
</style>

<div class="cover"></div>
<a class="set-view-mode" href="javascript:void(0)" title="夜间模式">
    <i class="fa fa-moon-o"></i>
</a>

<script>
$(function(){
    btn = $('.set-view-mode');
    if(sessionStorage.mode=="night"){
        $('body').addClass('night-mode');
        btn.find('i').attr('class','fa fa-sun-o');
    }
    $('.set-view-mode').click(function(){
        var next_mode = $('body').hasClass('night-mode') ? 'day':'night';
        if(next_mode!='day'){
            $('body').addClass('night-mode');
            btn.find('i').attr('class','fa fa-sun-o');
            sessionStorage.mode="night";
        }else{
            $('body').removeClass('night-mode');
            btn.find('i').attr('class','fa fa-moon-o');
            sessionStorage.mode="day";
        }
    });
});
</script>

<!--夜间模式结束-->

<!-- 复制弹窗提示开始 -->
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<script>
  window.onload = function(){
    document.body.oncopy = function() {
      swal({
        title: "复制成功！",
        text: "若要转载请务必保留原文链接并注明来源，谢谢合作！",
        icon: "success",
        buttons: false,
        closeOnClickOutside: false,
        timer: 1500,
     });
    };
  }
</script>
<!-- 复制弹窗提示结束 -->

<!--浏览进度条开始-->

<style>
    .read_progress {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 3px;
        background-color: #eee;
    }
    .read_progress_inner {
        content: '';
        position: absolute;
        left: 0;
        height: 100%;
        background-color: #00b2ff;
    }
</style>

<div class="read_progress">
    <div class="read_progress_inner" id="read_progress_inner"></div>
</div>

<script>
document.addEventListener('scroll', function(e) {
    var scrollTop = document.documentElement.scrollTop || document.body.scrollTop; // 已经读过被卷起来的文档部分
    var scrollHeight = document.documentElement.scrollHeight // 文档总高度
    var clientHeight = document.documentElement.clientHeight // 窗口可视高度
    document.getElementById('read_progress_inner').style.width = +(scrollTop/(scrollHeight-clientHeight)).toFixed(2)*100 + '%'
})
</script>

<!--浏览进度条结束-->


</body>

<input hidden id="copy" />
<script>
  !function () {
    let times = document.querySelectorAll('.publish-time');
    for (let i = 0; i < times.length; i++) {
      let date = times[i].dataset.t;
      let time = Math.floor((new Date().getTime() - new Date(date).getTime()) / 1000);
      if (time < 60) {
        str = time + '秒之前';
      } else if (time < 3600) {
        str = Math.floor(time / 60) + '分钟之前';
      } else if (time >= 3600 && time < 86400) {
        str = Math.floor(time / 3600) + '小时之前';
      } else if (time >= 86400 && time < 259200) {
        str = Math.floor(time / 86400) + '天之前';
      } else {
        str = times[i].textContent;
      }
      times[i].textContent = str;
    }
  }();
</script>

<script>
  let language = '';
  if (language !== '') {
    let map = new Map();
    if (language === 'en') {
      map.set('search', 'Search');
      map.set('category', 'Categories');
      map.set('article', 'Articles');
      map.set('tag', 'Tags');
      map.set('top', 'Top');
      map.set('publish', 'published');
      map.set('minute', ' minutes');
      map.set('read-more', 'Read More');
      map.set('view', 'View');
      map.set('words', ' words');
      map.set('category-in', 'category in');
      map.set('preview', 'Meta');
      map.set('index', 'Toc');
      map.set('no-archives', "You haven't created yet");
      map.set('archives', " articles in total");
      map.set('cloud-tags', " tags in total");
      map.set('copyright', "Copyright: ");
      map.set('author', "Author: ");
      map.set('link', "Link: ");
      map.set('leave-message', "Leave a message");
      map.set('format', "Links Format");
      map.set('site-name', "Name: ");
      map.set('site-link', "Link: ");
      map.set('site-desc', "Desc: ");
      map.set('stat', " related results, taking ");
      map.set('stat-time', " ms");
      map.set('site-img', "Image: ");
    }

    if (map.size > 0) {
      let lanElems = document.querySelectorAll('.language');
      lanElems.forEach(elem => {
        let lan = elem.dataset.lan, text = map.get(lan);
        if (elem.__proto__ === HTMLInputElement.prototype) {
          elem.placeholder = text
        } else {
          if (elem.dataset.count) {
            text = elem.dataset.count + text;
          }
          elem.textContent = text;
        }
      })
    }
  }

  window.Clipboard = (function (window, document, navigator) {
    var textArea,
      copy;

    // 判断是不是ios端
    function isOS() {
      return navigator.userAgent.match(/ipad|iphone/i);
    }
    //创建文本元素
    function createTextArea(text) {
      textArea = document.createElement('textArea');
      textArea.value = text;
      textArea.style.width = 0;
      textArea.style.height = 0;
      textArea.clientHeight = 0;
      textArea.clientWidth = 0;
      document.body.appendChild(textArea);
    }
    //选择内容
    function selectText() {
      var range,
        selection;

      if (isOS()) {
        range = document.createRange();
        range.selectNodeContents(textArea);
        selection = window.getSelection();
        selection.removeAllRanges();
        selection.addRange(range);
        textArea.setSelectionRange(0, 999999);
      } else {
        textArea.select();
      }
    }

    //复制到剪贴板
    function copyToClipboard() {
      try {
        document.execCommand("Copy")
      } catch (err) {
        alert("复制错误！请手动复制！")
      }
      document.body.removeChild(textArea);
    }

    copy = function (text) {
      createTextArea(text);
      selectText();
      copyToClipboard();
    };

    return {
      copy: copy
    };
  })(window, document, navigator);

  function copyCode(e) {
    if (e.srcElement.tagName === 'SPAN' && e.srcElement.classList.contains('copy-code')) {
      let code = e.currentTarget.querySelector('code');
      var text = code.innerText;
      if (e.srcElement.textContent === '复制成功') {
        return;
      }
      e.srcElement.textContent = '复制成功';
      (function (elem) {
        setTimeout(() => {
          if (elem.textContent === '复制成功') {
            elem.textContent = '复制代码'
          }
        }, 1000);
      })(e.srcElement)
      Clipboard.copy(text);
    }
  }

  let pres = document.querySelectorAll('pre');
  pres.forEach(pre => {
    let code = pre.querySelector('code');
    let copyElem = document.createElement('span');
    copyElem.classList.add('copy-code');
    copyElem.textContent = '复制代码';
    pre.appendChild(copyElem);
    pre.onclick = copyCode
  })

</script>
<script src="/media/js/motion.js"></script>


  <script
    src="https://cdn.jsdelivr.net/gh/cferdinandi/smooth-scroll/dist/smooth-scroll.polyfills.min.js"></script>
  <script>
    var scroll = new SmoothScroll('a[href*="#"]', {
      speed: 200
    });
  </script>



<canvas class="fireworks" style="position: fixed;left: 0;top: 0;z-index: 1; pointer-events: none;"></canvas>
<script type="text/javascript" src="//cdn.bootcss.com/animejs/2.2.0/anime.min.js"></script>
<script type="text/javascript" src="/media/js/mouse/fireworks.js"></script>


  <script src="/media/js/cool.js"></script>



</html>